package com.ourteam.product.ui.domain;
/**
 * Template Name : DTO数据对象 Template Version : 1 Template Last Modfiy Date : Fri Nov 30 16:49:33 CST
 * 2018 Auto Generate Date : 2018-12-14 15:15:20 Warning ! This file will be overwrite when
 * regenerate !
 */
import java.util.HashMap;
import java.util.Map;
import net.dao.IDataPopulateCallback;
import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

public class ProductUIDomainBean implements java.io.Serializable {

  private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

  private com.ourteam.product.ui.dao.ProductUIDomain productUIDomain;

  protected BeanMap getBeanMap() {

    return new BeanMap(productUIDomain);
  }

  static {
    mappedDaoFields.put("id", com.ourteam.product.ui.dao.IProductUIDomainDAO.Id);

    mappedDaoFields.put("domainCode", com.ourteam.product.ui.dao.IProductUIDomainDAO.DomainCode);

    mappedDaoFields.put("domainName", com.ourteam.product.ui.dao.IProductUIDomainDAO.DomainName);

    mappedDaoFields.put("status", com.ourteam.product.ui.dao.IProductUIDomainDAO.Status);

    mappedDaoFields.put("remarks", com.ourteam.product.ui.dao.IProductUIDomainDAO.Remarks);
  }

  public static String getMappedDAOField(String aAttrName) {
    return mappedDaoFields.get(aAttrName);
  }

  public ProductUIDomainBean() {
    super();

    this.productUIDomain = new com.ourteam.product.ui.dao.ProductUIDomain();
  }

  public ProductUIDomainBean(com.ourteam.product.ui.dao.ProductUIDomain productUIDomain) {
    super();

    this.productUIDomain = productUIDomain;
  }

  public com.ourteam.product.ui.dao.ProductUIDomain convertToProductUIDomain() {
    return this.productUIDomain;
  }

  public com.ourteam.product.ui.dao.ProductUIDomain convertTo() {
    return this.productUIDomain;
  }

  /**
   * Get id
   *
   * @return long
   */
  public long getId() {
    return (long) this.productUIDomain.getId();
  }

  /**
   * Set id
   *
   * @parameter long
   */
  public void setId(long id) {

    this.productUIDomain.setId(id);
  }

  /**
   * Get domainCode
   *
   * @return String
   */
  public String getDomainCode() {
    return (String) this.productUIDomain.getDomainCode();
  }

  /**
   * Set domainCode
   *
   * @parameter String
   */
  public void setDomainCode(String domainCode) {

    this.productUIDomain.setDomainCode(domainCode);
  }

  /**
   * Get domainName
   *
   * @return String
   */
  public String getDomainName() {
    return (String) this.productUIDomain.getDomainName();
  }

  /**
   * Set domainName
   *
   * @parameter String
   */
  public void setDomainName(String domainName) {

    this.productUIDomain.setDomainName(domainName);
  }

  /**
   * Get status
   *
   * @return String
   */
  public String getStatus() {
    return (String) this.productUIDomain.getStatus();
  }

  /**
   * Set status
   *
   * @parameter String
   */
  public void setStatus(String status) {

    this.productUIDomain.setStatus(status);
  }

  /**
   * Get remarks
   *
   * @return String
   */
  public String getRemarks() {
    return (String) this.productUIDomain.getRemarks();
  }

  /**
   * Set remarks
   *
   * @parameter String
   */
  public void setRemarks(String remarks) {

    this.productUIDomain.setRemarks(remarks);
  }

  public int hashCode() {
    return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
  }

  public boolean equals(Object obj) {
    if (obj == null) {
      return false;
    } // end if

    if ((obj instanceof ProductUIDomainBean) == false) {
      return false;
    } // end if

    ProductUIDomainBean other = (ProductUIDomainBean) obj;

    boolean isEqual = false;

    com.ourteam.product.ui.dao.ProductUIDomain tempProductUIDomain =
        other.convertToProductUIDomain();

    if (tempProductUIDomain == null || this.productUIDomain == null) {
      isEqual = false;
    } else if (tempProductUIDomain == this.productUIDomain
        || tempProductUIDomain.equals(this.productUIDomain)) {
      isEqual = true;
    } else {
      isEqual = false;
    }

    return isEqual;
  }

  public static ProductUIDomainBean[] toArray(
      com.ourteam.product.ui.dao.ProductUIDomain[] aProductUIDomains) {

    return toArray(aProductUIDomains, null);
  }

  public static ProductUIDomainBean[] toArray(
      com.ourteam.product.ui.dao.ProductUIDomain[] aProductUIDomains,
      IDataPopulateCallback aCallBack) {

    if (ArrayUtils.isEmpty(aProductUIDomains)) {
      return new ProductUIDomainBean[0];
    }

    int length = aProductUIDomains.length;

    ProductUIDomainBean[] beans = new ProductUIDomainBean[length];

    for (int i = 0; i < length; i++) {
      beans[i] = new ProductUIDomainBean(aProductUIDomains[i]);
      if (aCallBack != null) {
        aCallBack.populate(beans[i], new Object[] {aProductUIDomains[i]});
      }
    }

    return beans;
  }
}
